import Vue from 'vue'

import verify from 'vue-verify-plugin'
import store from 'store'

import Router from 'vue-router'
import Hello from '@/components/Hello'
// 导入页面组件
import Home from '@/pages/home'

import HomeSec from '@/pages/homeSec'

// @就相当于省略所在文件夹这一级目录
import Classify from '@/pages/classify'
import Pharmaceuticals from '@/pages/classify/Pharmaceuticals'
import NourishingHealth from '@/pages/classify/NourishingHealth'
import CalciumVitamin from '@/pages/classify/CalciumVitamin'
import ContactLenses from '@/pages/classify/ContactLenses'
import Medical from '@/pages/classify/Medical'
import products from '@/pages/classify/products'
import GinsengTea from '@/pages/classify/GinsengTea'
import drugstore from '@/pages/classify/drugstore'


// 也可以写全组件的位置
import Cart from '../pages/cart'
import CartItems from '../pages/cartItems'
import Mine from '../pages/mine'

Vue.use(Router)

const User = {
  template: `
   <div class="login">
    <header>
          <a href ="http://localhost:8080/#/home"><span class="icon">&#xe6b0;</span></a>       
          <h1>登陆</h1>
    </header>
    <div class="main">
        <div class="log_type">
            <span class="user_icon">&#xe60d;</span>
            <input type="text" placeholder="手机号/邮箱/用户名" name class="userName" />
            <p class="name_empty"></p>
        </div>
        <div class="log_type">
            <span class="pas_icon">&#xe60a;</span>
            <input type="password" placeholder="密码" name class="passWord" />
            <p class="pasword_empty"></p>
        </div>
        <div class="login_foo" >
            <a href="http://localhost:8080/#/mine">登陆</a>
        </div>
    </div>
  </div>
          `
}

import LoginCss from '../../static/login.css'


export default new Router({
        store,
        routes: [
        {
          path: '/',
          name: 'Home',
          // 此处的值(Home)对应导入页面组件之后的组件名字
          component: Home
        },{
          // path对应的是锚点
          path: '/home',
          name: 'Home',
          component: Home 
        },{
          // path对应的是锚点
          path: '/homeSec',
          name: 'Home',
          component: HomeSec 
        },{
          path: '/classify',
          name: 'Classify',
          component: Classify, children: [
            {path: '', component: Pharmaceuticals},
            {path: 'Pharmaceuticals', component: Pharmaceuticals},
            {path: 'NourishingHealth', component: NourishingHealth},
            {path: 'CalciumVitamin', component: CalciumVitamin},
            {path: 'ContactLenses', component: ContactLenses},
            {path: 'Medical', component: Medical},
            {path: 'products', component: products},
            {path: 'GinsengTea', component: GinsengTea},
            {path: 'drugstore', component: drugstore}        
       ] },{
          path: '/cart',
          name: 'Cart',
          component: Cart
        },{
          path: '/cartItems',
          name: 'CartItems',
          component: CartItems
        },{
          path: '/mine',
          name: 'Mine',
          component: Mine
        },{
          path: '/user/:id.html',
          name: 'Login',
          component: User
        }
      ]
})
